Previous Book Contents Book Index Next

Inside Macintosh: Open Transport /
Chapter 10 - AppleTalk Addressing / AppleTalk Addressing Reference
Functions


OTSetNBPEntityFromAddress

Parses and stores an NBP address into an NBP entity.

C INTERFACE
Boolean OTSetNBPEntityFromAddress (NBPEntity* nbpEntity, 
                                   const UInt8* addrBuf, 
                                   size_t len);
C++ INTERFACES
None. C++ applications use the C interface to this function.

PARAMETERS
nbpEntity
A pointer to the NBP entity in which you wish to store
an address.
addrBuf
A pointer to the address buffer in which to store the NBP
name string.
len
The number of characters to parse and store.
DESCRIPTION
The OTSetNBPEntityFromAddress function parses an NBP address or a combined DDP-NBP address into the NBP name's constituent parts (name, type, and zone) and stores the result in an NBP entity. The function ignores the DDP address part of a combined DDP-NBP address. From the NBP entity, each of the constituent parts of the name can be later retrieved or changed.

This function returns true if it worked successfully; it returns false if it had to truncate any data--that is, if the address had data that was too long in one of the fields, each of which only holds 32 characters of data. When this occurs, Open Transport still stores the data, but in a truncated form.

SEE ALSO
The NBP entity structure is described in the section "The NBP Entity Structure," beginning on page 10-20.

The NBP address structure is described in the section "The NBP Address Structure," beginning on page 10-17.

The combined DDP-NBP entity structure is described in the section "The Combined DDP-NBP Address Structure," beginning on page 10-17.

To copy the contents of an NBP entity into an NBP address structure, use the OTSetAddressFromNBPEntity function (page 10-27).

To determine the appropriate buffer size for an NBP entity, use the OTGetNBPEntityLengthAsAddress function (page 10-26).

To store the NBP name in an NBP entity, use the OTSetNBPName function (page 10-31); to store the NBP type, use the OTSetNBPType function (page 10-32); and to store the NBP zone, use the OTSetNBPZone function (page 10-34).

To extract the name portion of an NBP name from an NBP entity, use the OTExtractNBPName function (page 10-35); to extract the type portion of an NBP name, use the OTExtractNBPType function (page 10-36); and to extract the zone portion, use the OTExtractNBPZone function (page 10-37).


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 AUG 1996